#include<iostream>
#include <unistd.h>
using namespace std;
#include <vector>
#include "thread.hpp"
void fun(int x)
{
    while(true)
    {
        cout<<"hello thread!!! NUM:"<<x<<endl;
               
        sleep(1);
    }
}

int main()  
{
    vector<thread>threads;
    for(int i=0;i<10;i++)
    {
        thread t(fun,i);
        threads.push_back(t);
    }
    for(auto&e:threads)
    {
        e.run();
        cout<<"Thread name is:"<<e.threadname()<<" ,thread is running:"<<e.is_running()<<" ,"
        <<"thread running time: "<<e.threadrunningtime()<<endl;
        
    }
    for(auto&e:threads)
    {
        e.join();
    }

    return 0;
}